import pdf from 'vue-pdf'
export default {
  components: {pdf},
  props: [],
  data() {
    return {
      loading: false,
      visible: false,
      txtTitle: '',

      pageNum: 1,
      pageTotalNum: 1,
      loadedRatio: 0,
      pdfUrl: ''
    }
  },
  computed: {},
  watch: {

  },
  created() {

  },
  mounted() {
    // this.$store.dispatch('base/getDictionaryData', { sort: 'Brand' }).then(res => {
    //   this.brandOptions = res
    // })
  },
  methods: {
    // 上一页
    prePage () {
      let page = this.pageNum
      page = page > 1 ? page - 1 : this.pageTotalNum
      this.pageNum = page
    },
    // 下一页
    nextPage () {
      let page = this.pageNum
      page = page < this.pageTotalNum ? page + 1 : 1
      this.pageNum = page
    },
    goBack() {
      this.$emit('refresh')
    },
    init(url, title) {
      this.visible = true;
      this.pdfUrl = url
      this.txtTitle = title
    }

  }
}
